-
Notifications
You must be signed in to change notification settings - Fork 213
/
CMakeLists.txt
executable file
·97 lines (81 loc) · 3.7 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
cmake_minimum_required(VERSION 3.10)
project(qucs-suite CXX)
file(STRINGS "${qucs-suite_SOURCE_DIR}/VERSION" QUCS_VERSION)
message(STATUS "Configuring Qucs: VERSION ${QUCS_VERSION}")
set(QUCS_URL "https://sf.net/p/qucs")
set(QUCS_BUGREPORT "[email protected]")
set(GIT unknown)
if(EXISTS ${CMAKE_SOURCE_DIR}/../.git)
find_package(Git)
# Get the latest abbreviated commit hash of the working branch
execute_process(
COMMAND ${GIT_EXECUTABLE} log --pretty=format:%h -n 1u
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_COMMIT_HASH)
set(GIT ${GIT_COMMIT_HASH})
message(STATUS "Found Git repository, last commit hash: ${GIT}")
endif()
set(PROJECT_VERSION ${QUCS_VERSION})
message(STATUS "${PROJECT_NAME} ${CMAKE_INSTALL_PREFIX}
${qucs-suite_BINARY_DIR}")
find_package(Qt5 COMPONENTS Widgets REQUIRED)
add_definitions(${QT_DEFINITIONS} -DQT_DEPRECATED_WARNINGS)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/man/qucs.1.cmake.in
${CMAKE_CURRENT_SOURCE_DIR}/man/qucs.1)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/man/qucsdigi.1.cmake.in
${CMAKE_CURRENT_SOURCE_DIR}/man/qucsdigi.1)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/man/qucsdigilib.1.cmake.in
${CMAKE_CURRENT_SOURCE_DIR}/man/qucsdigilib.1)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/man/qucsveri.1.cmake.in
${CMAKE_CURRENT_SOURCE_DIR}/man/qucsveri.1)
configure_file(${PROJECT_SOURCE_DIR}/config.h.cmake
${PROJECT_BINARY_DIR}/config.h)
# Tools
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/qucs-activefilter/qucsactivefilter.1.cmake.in
${CMAKE_CURRENT_SOURCE_DIR}/qucs-activefilter/qucsactivefilter.1)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/qucs-filter/qucsfilter.1.cmake.in
${CMAKE_CURRENT_SOURCE_DIR}/qucs-filter/qucsfilter.1)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/qucs-attenuator/qucsattenuator.1.cmake.in
${CMAKE_CURRENT_SOURCE_DIR}/qucs-attenuator/qucsattenuator.1)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/qucs-lib/qucslib.1.cmake.in
${CMAKE_CURRENT_SOURCE_DIR}/qucs-lib/qucslib.1)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/qucs-powercombining/qucspowercombining.1.cmake.in
${CMAKE_CURRENT_SOURCE_DIR}/qucs-powercombining/qucspowercombining.1)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/qucs-rescodes/qucsrescodes.1.cmake.in
${CMAKE_CURRENT_SOURCE_DIR}/qucs-rescodes/qucsrescodes.1)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/qucs-transcalc/qucstrans.1.cmake.in
${CMAKE_CURRENT_SOURCE_DIR}/qucs-transcalc/qucstrans.1)
#set(UNIT_TEST "")
add_custom_target(
qucsator
COMMAND pushd ${CMAKE_CURRENT_SOURCE_DIR}/qucsator && autoreconf -ivf && CXX=g++-12 ./configure --prefix=${CMAKE_CURRENT_BINARY_DIR} && make && make install && popd
)
add_custom_command(
TARGET qucsator
COMMAND pushd ${CMAKE_CURRENT_SOURCE_DIR}/qucsator && autoreconf -ivf && CXX=g++-12 ./configure --prefix=${CMAKE_CURRENT_BINARY_DIR} && make && make install && popd
)
add_subdirectory(man)
add_subdirectory(qucs)
add_subdirectory(qucs-activefilter)
add_subdirectory(qucs-attenuator)
#add_subdirectory(qucs-doc)
add_subdirectory(qucs-filter)
add_subdirectory(qucs-lib)
add_subdirectory(qucs-transcalc)
add_subdirectory(qucs-rescodes)
add_subdirectory(examples)
add_subdirectory(translations)
add_subdirectory(contrib)
add_subdirectory(qucs-powercombining)
# enable testing for current directory and below
enable_testing()
add_subdirectory(tests)
#
# Custom uninstall target
#
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/uninstall.cmake" IMMEDIATE @ONLY)
add_custom_target(uninstall-ui COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/uninstall.cmake)